package com.appwoo.txtws.activity;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import com.appwoo.txtws.component.HomeManage;
import com.appwoo.txtws.component.LockLayer;

public class DirectionActivity extends Activity
{
  private boolean blDireAsyncTask = false;
  private LinearLayout layout = null;
  private View lock;
  private LockLayer lockLayer;

  private void onLock()
  {
    this.lockLayer = LockLayer.getInstance(this);
    this.lockLayer.setLockView(this.lock);
    this.lockLayer.lock();
  }

  private void onUnlock()
  {
    this.lockLayer.unlock();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.lock = View.inflate(this, 2130903096, null);
    this.layout = ((LinearLayout)this.lock.findViewById(2131493101));
    this.layout.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (!DirectionActivity.this.blDireAsyncTask)
          new DirectionActivity.DireAsyncTask(DirectionActivity.this).execute(new String[] { "checkhome" });
      }
    });
  }

  protected void onDestroy()
  {
    onUnlock();
    super.onDestroy();
  }

  protected void onPause()
  {
    onUnlock();
    super.onPause();
  }

  protected void onResume()
  {
    super.onResume();
    onLock();
  }

  public class DireAsyncTask extends AsyncTask<String, Integer, String>
  {
    private String method = "";
    private ProgressDialog v_progressDialog;

    public DireAsyncTask()
    {
    }

    private void createOrShowDialog()
    {
      if ((this.v_progressDialog == null) || (!this.v_progressDialog.isShowing()))
      {
        this.v_progressDialog = new ProgressDialog(DirectionActivity.this);
        this.v_progressDialog.setMessage(DirectionActivity.this.getString(2131427516));
        this.v_progressDialog.setCancelable(true);
        if (!this.v_progressDialog.isShowing())
          this.v_progressDialog.show();
      }
    }

    protected String doInBackground(String[] paramArrayOfString)
    {
      try
      {
        this.method = paramArrayOfString[0];
        if (this.method.equals("checkhome"))
          HomeManage.getInstance().dirCheckHome(DirectionActivity.this);
        return "";
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }

    protected void onPostExecute(String paramString)
    {
      super.onPostExecute(paramString);
      try
      {
        if (this.method.equals("checkhome"))
        {
          Intent localIntent = new Intent("android.intent.action.MAIN");
          localIntent.setFlags(268435456);
          localIntent.addCategory("android.intent.category.HOME");
          DirectionActivity.this.startActivity(localIntent);
          DirectionActivity.this.finish();
        }
        com.appwoo.txtws.component.Global.inDire = false;
        this.v_progressDialog.dismiss();
        return;
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
        return;
      }
      finally
      {
        DirectionActivity.this.blDireAsyncTask = false;
      }
    }

    protected void onPreExecute()
    {
      super.onPreExecute();
      try
      {
        DirectionActivity.this.blDireAsyncTask = true;
        createOrShowDialog();
        com.appwoo.txtws.component.Global.inDire = true;
        return;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.DirectionActivity
 * JD-Core Version:    0.6.2
 */